﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.InteropServices;
using System.Text;
using System.Threading.Tasks;

namespace MyTcpIp.configuration
{
    /// <summary>
    /// 转速配置
    /// </summary>
    /// 
    [StructLayoutAttribute(LayoutKind.Sequential, Pack = 4)]
    public struct SpeedConfig
    {
        /// <summary>
        /// 转速通道使能
        /// </summary>
        public char enable;

        /// <summary>
        /// 键相ID 值从1开始
        /// </summary>
        public UInt16 KeyPhaseID;

        /// <summary>
        /// 键相名称 xxxxx
        /// </summary>
        [MarshalAs(UnmanagedType.ByValArray, SizeConst = 128)]
        public char[] KeyPhaseName;

        /// <summary>
        /// 键相安装角度   xxxxx
        /// </summary>
        public float KeyPhaseAngle;

        /// <summary>
        /// 旋转方向 0：顺时针  1：逆时针    xxxxx
        /// </summary>
        public UInt16 RotationDirection;

        /// <summary>
        /// 运行模式    1：键相槽手动，2：键相槽手动，3:齿轮盘手动，4：齿轮盘自动，0：无效数据
        /// </summary>	
        public byte RunMod;

        /// <summary>
        /// 比较电压系树齿轮齿数
        /// </summary>
        public byte CompareVol;

        /// <summary>
        /// 齿轮齿数
        /// </summary>  
        public UInt16 GearTeethNum;

        public float KeySlotMax;

        public float KeySlotMin;

        public float GearMax;

        public float GearMin;

        public float GearKey;
    }
}
